<%= stylesheet_link_tag 'application', :plugin => 'redmine_git_hosting' %>

  <h3><%= l(:label_my_public_keys) %></h3>

  <fieldset class="public_key_view">
    <legend><%= l(:label_current_user_keys) %></legend>
    <%= render :partial => 'gitolite_public_keys/ssh_keys', :locals => {:ssh_keys => @gitolite_user_keys} %>
  </fieldset>

  <br/>

  <fieldset class="public_key_view">
    <legend><%= l(:label_current_deploy_keys) %></legend>
    <%= render :partial => 'gitolite_public_keys/ssh_keys', :locals => {:ssh_keys => @gitolite_deploy_keys} %>
  </fieldset>

  <br/>

  <fieldset class="public_key_view">
    <legend><%= l(:label_public_key_new) %></legend>
    <%= render :partial => 'gitolite_public_keys/form', :locals => {:user => @user} %>
  </fieldset>

<%= javascript_tag do %>
  function key_type_change(element) {
    var idx = element.selectedIndex;
    if (idx == 0) {
      $('#key_type_options').hide();
      $('#gitolite_public_key_delete_when_unused').prop("checked", true);
    } else {
      $('#key_type_options').show();
    }
  }

  $(document).ready(function() {
    $('#gitolite_public_key_key_type').on('change', function() {
      key_type_change(this)
    });
  });
<% end %>
